/*
 * Parser.h
 *
 *  Created on: 2010-6-10
 *      Author: guobc
 */

#ifndef PARSER_H_
#define PARSER_H_

#include "NodeFactory.h"
#include "ASTDom.h"

namespace HA {

/**
 * This is an interface, user could not create an object using this class
 */
class Parser {
public:
	/**
	 * Construct method.
	 */
	Parser() {
	}

	/**
	 * Parse character stream.
	 */
	virtual void parse() throw (ParserException)= 0;

	/**
	 * Get root node after parsing.
	 * @return
	 */
	virtual ASTNode* getRootNode() = 0;

protected:

	/**
	 * Get node factory that crate AST node.
	 * @return Node factory.
	 */
	virtual NodeFactory getNodeFactory() = 0;

//	/**
//	 * Get a document
//	 * @return
//	 */
//	virtual ASTDom* getDocument() = 0;

};
}

#endif /* PARSER_H_ */
